package strategy;

/**
 * 打折收费
 */
public class CashRebate implements CashStrategy {
    private double moneyRebate = 1d; // 折扣率

    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double price, int num) {
        return price * num * moneyRebate;
    }
}
